home *** CD-ROM | disk | FTP | other *** search
/ Windows 32-Bit Gallery / Windows 32-bit Gallery.iso / win95 / winbatch / progman.wi_ < prev    next >
Text File  |  1996-11-20  |  4KB  |  143 lines

  1. ;;Program manager WBT script.  Adding/Deleting/Showing Program Manager Groups and Icons.  
  2.  
  3.                     ;;Written February 1994  by Wilson WindowWare, Inc.  
  4.  
  5. ;;Call Progman.wil
  6. ;;Syntax of commands:
  7. ;;    Call("progman.wil", "AddGroup 'Group Title'")
  8. ;;        (             , "DelGroup 'Group Title'")
  9. ;;        (             , "AddIcon 'Group Title' 'File and Path' 'Icon Description'")
  10. ;;        (             , "DelIcon 'Group Title' 'Icon Description'")
  11. ;;        (             , "ShowGroup 'Group Title' ShowCommand")
  12. ;;        (             , "ReplaceItem 'Group Title' 'Icon Description'")
  13. ;;        (             , "Reload 'Group Title'")
  14.  
  15.  
  16. ;;Show command is an integer which specifies the action Program Manager is to perform on the group window.
  17. ;;        VALUE          ACTION
  18. ;;          1               Restores group to its original size and position.
  19. ;;          2               Displays group as an icon.
  20. ;;          3               Displays group as a maximized window.
  21. ;;          6               Minimizes the group window.
  22. ;;                                 
  23.  
  24. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  27. ;Check to see if Program manager is running.  If not, run it.
  28. AX=DDEInitiate("Progman", "Progman")
  29. IF AX==0    ; Hmmm nobody's home
  30.     run("progman.exe","")
  31.     delay(2)
  32.     AX=DDEInitiate("Progman", "Progman")
  33.     If AX==0     ;   ooooo its really dead.  Give up
  34.          Message("Program Manager DDE Initiate", "Didn't work.  Giving up.  Going home")
  35.          return 
  36.     endif
  37. endif
  38.  
  39.  
  40. ErrorMode(@OFF)
  41. If AppExist("Progman.exe")  then WinActivate("Program Manager")
  42. ErrorMode(@ON)
  43. ErrorMSG=""
  44. ; Fake a case statement with a string for a variable
  45. Goto %Param1%
  46.            
  47.  
  48.  
  49. :ADDGROUP
  50. ;Add a group to program manager.                                                              
  51.      
  52. Err=DDEExecute(AX,"[CreateGroup(%param2%)]")
  53. If Err==0 then ErrorMSG="[CreateGroup(%param2%)] Failed"
  54. goto byebye
  55.  
  56.  
  57.  
  58.  
  59. :DELGROUP
  60. ;Delete a group from the program manager.
  61.      
  62. Err=DDEExecute(AX,"[DeleteGroup(%param2%)]")
  63. If Err==0 then ErrorMSG="[DeleteGroup(%param2%)] Failed"
  64. goto byebye
  65.  
  66.  
  67.  
  68. :ADDICON
  69. ;Add an icon to a program group.
  70.  
  71. ;show or create the group first.
  72. DDEExecute(AX,"[CreateGroup(%param2%)]")
  73. ;Add the item.     
  74. Err=DDEExecute(AX,"[AddItem(%param3%,%param4%,,,-1,-1,,,0)]")
  75. If Err==0 then ErrorMSG="[AddItem(%param3%,%param4%,,,-1,-1,,,0)] Failed"
  76. goto byebye
  77.  
  78.  
  79.  
  80.  
  81.  
  82. :DELICON
  83. ;Delete an icon from the program manager.
  84.  
  85. ;show or create the group
  86. DDEExecute(AX,"[ShowGroup(%param2%,1)]")
  87. ;Delete the icon.     
  88. Err=DDEExecute(AX,"[DeleteItem(%param3%)]")
  89. If Err==0 then ErrorMSG="[DeleteGroup(%param3%)] Failed"
  90. goto byebye
  91.  
  92.  
  93.  
  94.  
  95. :SHOWGROUP
  96. ;Show a program group. 
  97.      
  98. ;show or create the group
  99. Err=DDEExecute(AX,"[ShowGroup(%param2%,%param3%,)]")
  100. If Err==0 then ErrorMSG="[ShowGroup(%param2%,%param3%,)] Failed"
  101. goto byebye
  102.  
  103.  
  104.  
  105.  
  106. :RELOAD
  107. ;This command instructs Program Manager to remove and reload an existing group.
  108.  
  109. ;Show the group.
  110. DDEExecute(AX,"[ShowGroup(%param2%,1)]")
  111. delay(2)
  112. Err=DDEExecute(AX,"[Reload(%param2%)]")
  113. If Err==0 then ErrorMSG="[Reload(%param2%)] Failed"
  114. goto byebye
  115.  
  116.  
  117.  
  118.  
  119. :REPLACEITEM
  120. ;This command deletes an item and records the position.  A new item can be added to this 
  121. ;position using AddIcon.
  122.  
  123. ;Show the group.
  124. DDEExecute(AX,"[ShowGroup(%param2%,1)]")
  125. delay(2)
  126.  
  127. ;record the position and delete existing group.
  128. Err=DDEExecute(AX,"[ReplaceItem(%param3%)]")
  129. If Err==0 then ErrorMSG="[ReplaceItem(%param3%)] Failed"
  130. goto byebye
  131.  
  132.  
  133.       
  134.  
  135.  
  136. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  137. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  138. :byebye
  139. DDETerminate(AX)
  140. If ErrorMSG!="" then message("Progman DDE Failed", ErrorMSG)
  141. RETURN
  142.  
  143.